<template>
 <div>
   <el-berad></el-berad>
   <el-button type="primary" size="medium" @click="add" >添加</el-button>
   <m-list @edit='edit'></m-list>
   <m-dialog ref="diaInfo" :dialogInfo='dialogInfo' @cancel='cancel'></m-dialog>
 </div>
</template>

<script>
import mList from './list'
import mDialog from './dialog'
export default {
 data() {
  return {
    dialogInfo:{
      isShow:false,
      isAdd:true
    }
  }
 },
 components:{
   mList,
   mDialog
 },
 mounted(){
 },
 methods:{
   add(){
     this.dialogInfo.isShow=true
     this.dialogInfo.isAdd=true
   },
   cancel(e){
     this.dialogInfo.isShow = e
   },
  edit(e){
    this.dialogInfo.isShow = true
    this.dialogInfo.isAdd = false
    this.$refs.diaInfo.lookup(e)
  }
 }
}
</script>

<style lang="less" scoped>
.el-button{
  margin-top: 20px;
}
</style>
